import http from './http'
// import Cookies from 'js-cookie'
// 登录功能接口
// const url1 = window.g.BaseURL1
const url = window.g.BaseURL
const url2 = window.g.BaseURL2
const url3 = window.g.BaseURL3
const url4 = window.g.BaseURL4
const url5 = window.g.BaseURL5
export function Login (pass, checkPass) {
    return http.get(url + 'api/user/login', {
        username: pass,
        password: checkPass
    })
}
export function farmerHouseGetToken (data) {
    return http.post(url + 'authserver/Auth/GetAccessToken', {
        code: data
    })
}
//微信单点
export function getwxAppletUser (data) {
    return http.get(url + 'api/farmerHouse/zlbsso/wxAppletUser?ticket='+data)
}
//faren
export function getFRSSOToken (data, data1) {
    return http.postJson(url + `api/farmerHouse/zlbsso/getFRSSOToken?ssotoken=${data}&ssoticket=${data1}`)
}
export function farmerHouseList (data) {
    return http.postJson(url + 'farmerHouse/proxy/data', data)
}
export function LoadGridData (data) {
    return http.post(url + 'dataserver/api/LoadGridData', data)
}
export function insertDataView (data) {
    return http.post(url + 'dataserver/api/insertDataView', data)
}
export function OpenDataView (data) {
    return http.post(url + 'dataserver/api/LoadGridData', data)
}
export function LoadSendFormData (data) {
    return http.get(url + 'WorkFlowServer/api/LoadSendFormData', data)
}
export function PlatSendTask (data) {
    return http.post(url + 'WorkFlowServer/api/PlatSendTask', data)
}
export function dataServerOpenDataView (dataGuid, searchObject, token) {
    return http.get(url + `dataServer/api/OpenDataView?dataGuid=${dataGuid}&searchObject=${searchObject}&time=1641788972092&token=${token}`)
}
export function InsertDataView (data) {
    return http.post(url + 'dataServer/api/InsertDataView', data)
}
export function Atlases (data) {
    return http.postJson(url2 + 'api/farmerHouse/zhejiangHouseAtlas/atlases', data)
}
export function Artisans (data) {
    return http.postJson(url2 + 'api/farmerHouse/zhejiangHouseArtisan/artisans', data)
}
export function Atlas (data) {
    return http.postJson(url2 + 'api/farmerHouse/zhejiangHouseAtlas/atlas', data)
}
export function getArtisans (data) {
    return http.postJson(url2 + 'api/farmerHouse/zhejiangHouseArtisan/getArtisan', data)
}
export function getLikeIt (data) {
    return http.postJson(url2 + 'api/farmerHouse/houseArtisanPraise/get', data)
}
export function CancelLike (data) {
    return http.postJson(url2 + 'api/farmerHouse/houseArtisanPraise/delete', data)
}

export function PrepareCreateProcess (data) {
    return http.post(url + 'WorkFlowServer/api/PrepareCreateProcess', data)
}
export function CreateProcess (data) {
    return http.post(url + 'WorkFlowServer/api/CreateProcess', data)
}
// export function PlatSendTask (data) {
//     return http.post(url + 'WorkFlowServer/api/PlatSendTask', data)
// }
export function FileServerUpload (data) {
    return http.postJson(url + 'FileServer/api/Upload', data)
}
export function FileServerProxy (data) {
    return http.postJson(url3 + 'api/farmerHouse/proxy/data/v4', data)
}
//图集收藏
export function followSave (data) {
    return http.postJson(url2 + 'api/farmerHouse/houseAtlasCollect/save', data)
}
//图集取消收藏
export function followDelete (data) {
    return http.postJson(url2 + 'api/farmerHouse/houseAtlasCollect/delete', data)
}
//图集点赞
export function thumbsUpSave (data) {
    return http.postJson(url2 + 'api/farmerHouse/houseAtlasPraise/save', data)
}
//图集取消点赞
export function thumbsUpDelete (data) {
    return http.postJson(url2 + 'api/farmerHouse/houseAtlasPraise/delete', data)
}
//工匠收藏
export function ArtisanfollowSave (data) {
    return http.postJson(url2 + 'api/farmerHouse/houseArtisanCollect/save', data)
}
//工匠取消收藏
export function ArtisanfollowDelete (data) {
    return http.postJson(url2 + 'api/farmerHouse/houseArtisanCollect/delete', data)
}
//工匠点赞
export function ArtisanthumbsUpSave (data) {
    return http.postJson(url2 + 'api/farmerHouse/houseArtisanPraise/save', data)
}
//工匠取消点赞
export function ArtisanthumbsUpDelete (data) {
    return http.postJson(url2 + 'api/farmerHouse/houseArtisanPraise/delete', data)
}
export function getSystemCityCode (data) {
    return http.postJson(url3 + '/api/farmerHouse/cityCode/getSystemCityCode', data)
}

export function UploadByUrl (data) {
    return http.postJson(url + 'FileServer/api/UploadByUrl', data)
}

export function updateDataView (data) {
    return http.post(url + 'dataServer/api/updateDataView', data)
}

export function CreateProcessAndSendTask (data) {
    return http.post(url + 'workflowserver/api/CreateProcessAndSendTask', data)
}
export function getUserName (data) {
    return http.get(url3 + '/api/farmerHouse/zlbsso/user/v4?ticket=' + data)
}
export function getPreview (data) {
    return http.get(url + 'FileServer/api/Preview?fileGuid=' + data)
}
//注册接口
export function getRegister (data) {
    return http.post(url + 'j-dataexchangeserver/hzRegister/register', data)
}

//注册接口
export function ExecProcedure (data) {
    return http.post(url + 'DataServer/api/ExecProcedure', data)
}
//查询接口
export function GetData (data) {
    return http.postJson(url + 'api/rescatalog/commonDataManager/query', data)
}
//查询附件接口
export function GetFileData (data) {
    return http.get(url + 'FileServer/api/GetFilesInfo', data)
}
//删除附件接口
export function DelectFile (data) {
    return http.post(url + 'FileServer/api/Delete', data)
}

//删除附件接口
export function dTalkAppUserInfo (data) {
    return http.get(url3 + '/api/farmerHouse/selfDingDing/dTalkAppUserInfo?authCode=' + data)
}

//获取图集收藏
export function AtlasCollection (data) {
    return http.postBody(url + 'api/farmerHouse/houseAtlasCollect/page', data)
}

//图集上传保存接口
export function AtlasUpload (data) {
    return http.postBody(url + 'api/gsa/sys/data/save', data)
}

//获取工匠收藏
export function ArtisanCollection (data) {
    return http.postBody(url + 'api/farmerHouse/houseArtisanCollect/page', data)
}
//监管平台登录
export function loginJGPT (data) {
    return http.get(url + 'api/user/login', data)
}
//监管平台上传附件
export function dataqueryFile (data) {
    return http.postJson(url + 'api/upload/file', data)
}

//获取图集点赞
export function AtlasThumbsUp (data) {
    return http.postBody(url + 'api/farmerHouse/houseAtlasPraise/get', data)
}

//获取行政区划
export function GetAdministrative (data) {
    return http.get(url + 'api/rescatalog/gsaCodeCity/listForTree/' + data)
}

//工匠签约量累加
export function SignNumAdd (data) {
    return http.postBody(url + '/api/farmerHouse/zhejiangHouseArtisan/ArtisanSignNumAdd/',data)
}
//图集签约量累加
export function PhotoNumAdd (data) {
    return http.postBody(url + '/api/farmerHouse/zhejiangHouseAtlas/atlasSignNumChange/',data)
}

//工匠签字接口
export function signGJ (data) {
    return http.postBody(url + 'j-dataexchangeserver/api/HXsign', data)
}
//农户签字接口
export function signNH (data) {
    return http.postBody(url + 'j-dataexchangeserver/api/NFHXsign', data)
}
//获取回调函数值
export function QuerySignCallback (data) {
    return http.postJson(url3 + 'api/farmerHouse/proxy/data/v4', data)
}
//获取回调函数值
export function QuerySignCallback1 (data) {
    return http.get(url + 'api/farmerHouse/govSign/QuerySignCallback/?pdfFileFlag='+data)
}
//更换单点登录统一支撑平台接口
//获取回调函数值
export function zlbssoUser (data) {
    return http.get(url + 'api/farmerHouse/zlbsso/user/v4?ticket='+data)
}
//注册接口
export function getRegister1 (data) {
    return http.postJson(url3 + '/api/farmerHouse/zlbsso//saveRel/v4', data)
}
//上传附件
export function dataTransFile (data) {
  return http.postJson(url3 + 'api/farmerHouse/proxy/dataTransFile/v4', data)
}

//预览文件
export function dataTransFilePreview (data) {
    return http.getImage(url3 + 'api/farmerHouse/proxy/dataTransFile/v4',data);
  }
// 推送门牌
export function doorplate (data) {
  return http.postJson(url + 'api/farmerHouse/farmhouse-number/doorplate/v1', data)
}
// 根据身份证号查询贷款信息
export function GetPrecredit (data) {
    return http.postJson(url3 + 'api/farmerHouse/offlineLoanPrecredit/getPrecreditInfoByCertNum', data)
}
// 贷款预授信提交
export function LoanPrecreditSubmit (data) {
    return http.postJson(url3 + 'api/farmerHouse/offlineLoanPrecredit/submit', data)
}

// 多图集上传
export function zhejiangHouseAtlasSave (data) {
    return http.postJson(url3 + 'api/farmerHouse/zhejiangHouseAtlas/save', data)
}

// 多文件id查询url
export function selectListByIds(data) {
    return http.get(url3 + '/api/upload/selectListByIds?id='+data)
}
// 上传图片带水印接口
export function drawImg(data) {
  return http.postJson(url3 + 'j-dataexchangeserver/image/drawImg',data)
}
export function getDoorplateList(data) {
    return http.postJson(url + 'api/farmerHouse/farmhouse-number/getDoorplateList',data)
}
//获取发送手机短信
export function sendBusinessMessage (data) {
    return http.postJson(url + 'api/farmerHouse/sms/sendBusinessMessage', data)
}
// 服务存量房屋基本信息
export function existHouseBaseInfo(data) {
  return http.get(url3 + 'api/farmerHouse/share/existHouseBaseInfo?'+data)
}
// 鉴定公司列表
export function getAuthenticateUnit(data) {
  return http.postJson(url3 + 'api/gsa/sys/data/query',data)
}

// 第三方入住
export function getThirdCompanySettled(data) {
    return http.postJson(url3 + '/api/farmerHouse/zhejiangHouseTechnicalUnit/thirdCompanySettled',data)
}
// 安全排查房屋数据

export function houseCheckDetail(data) {
  return http.get( url5 + 'houseCheck/detail/v1?'+data)
}
// 安全排查数据修改
export function saveOrUpdate(data) {
  return http.postJson( url5 + 'houseCheck/saveOrUpdate/v1',data)
}
// 鉴定公司鉴定编号
export function getNum(data) {
  return http.postJson(url3 + 'api/farmerHouse/numGenerate/getNum',data)
}
// 安全排查数据修改
export function changePcztByFwId(data) {
    return http.postJson( url5 + 'houseCheck/updateCheckStatus/v1',data)
  //return http.post( url5 + 'houseCheck/changePcztByFwId',data)
}
// 安全排查数据删除
export function houseCheckDelete(data) {
    var  p={};
    p.fwIds=data.fwIds;
    p.isDelete=1;
    return http.postJson( url5 + 'houseCheck/deleteCheckInfo/v1',p)
    // return http.postJson( url5 + 'houseCheck/delete?fwid='+data)
}
// 获取新的行政区划代码
export function houseCheckcityCodeTransFrom(data) {
    return http.postJson( url5 + 'houseCheck/cityCodeTransFrom?oldCityCode='+data)
}
// 本地测试
export function textData(data,data1,data2,data3,data4) {
    return http.get(url5 + `houseCheck/getHouseCheckList?pageSize=${data}&pageNum=${data1}&pczt=${data2}&cityCode=${data3}&fwlx=${data4}`)
}
//安全排查接口
export function seauthData(pageSize,pageNo,checkStatus,cityCode) {
    var   p={};
    p.pageSize=pageSize;
    p.pageNo=pageNo;
    p.checkStatus=checkStatus;
    p.cityCode=""//cityCode;

    return http.postJson(url5 + 'houseCheck/checkInfoList',p)
}
// getNumberData
export function getNumberData(data,data2,data3) {
    return http.get(url5 + `houseCheck/getCountByPczt?cityCode=${data}&pczt=${data2}&fwlx=${data3}`)
}
export function MP(ak) {
    return new Promise(function (resolve, reject) {
        window.onload = function () {
            resolve(window.BMap)
//插入script标签后 会在window上挂一BMap属性,此为跨域获取的数据
        };
        var script = document.createElement("script");
        script.type = "text/javascript";
        script.src = "http://api.map.baidu.com/api?v=2.0&ak=" + ak + "&callback=init";
        script.onerror = reject;
        document.head.appendChild(script);
//插入此标签后 会在window上挂一BMap属性,此为跨域获取的数据
    })
}
//将用户推送到gsa
export function sendUserToGsa(data) {
    return http.postJson(url + `/api/user/userManagerForHangZhou/saveOrUpdateUser`,data)
}
//获取用户基本信息
export function getUserInfoGSa(data) {
    return http.get(url2 + `api/user/userManagerForHangZhou/getUserInfo/`+data)
}
//获取gsa的枚举/api/sysmaintan/dataEnum/getDataEnumByGroupName
export function getDataEnumByGroupName(data) {
    return http.postJson(url2 + `api/sysmaintan/dataEnum/getDataEnumByGroupName/`,data)
}
//获取gsa的citycode枚举
export function getDatalistForTree(data) {
    return http.get(url2 + `api/rescatalog/gsaCodeCity/listForTree/`+data)
}

//签合同接口
export function HXSignForPlatForm(data) {
    return http.postJson('https://nfzjszlb.jst.zj.gov.cn/' + `api/farmerHouse/govSign/HXSignForPlatForm`,data)
}

//农房安全接口
export function houseCheckFwCheckList(data) {
    return http.postJson(url + `/api/farmerHouse/houseCheckFwCheck/countList`,data)
}
//农房安全接口
export function houseCheckFwCheckPage(data) {
    return http.postJson(url + `/api/farmerHouse/houseCheckFwCheck/pageList`,data)
}

//农房安全接口
export function houseCheckFwRoleUser(data) {
    return http.postJson(url + `/api/farmerHouse/houseCheckFwRoleUser/getRole/`+data)
}
//农房安全详情接口
export function houseCheckFwCheckDetails(data) {
  return http.get(url2 + `api/farmerHouse/houseCheckFwCheck/get/`+data)
}
//农房安全保存接口
export function FwsaveOrUpdate(data) {
  return http.postJson(url + `api/farmerHouse/houseCheckFwCheck/saveOrUpdate`,data)
}
//农房安全删除接口
export function FwsaveOrDelete(data) {
  return http.postJson(url + `api/farmerHouse/houseCheckFwCheck/delete/`+data)
}
//农房安全上传接口
export function uploadFile (data) {
  return http.postJson(url3 + 'api/upload/file', data)
}
//农房安全上传图片查询
export function selectListFile(data) {
  return http.get(url + `api/upload/selectListByIds`,data)
}
//农房安全上传图片删除
export function deleteFile(data) {
  return http.postJson(url + `api/upload/delete`,data)
}
//公安数据
export function getPoliceData(data){
    return http.postJson(url + `/api/farmerHouse/proxy/data`,data)

}
// 根据社会统一信用代码查询特殊行业信息
export function getTeshuInfo(data){
  return http.postJson(url + `api/farmerHouse/bizShareMaker/getTeshuInfo`,data)
}
// 根据社会统一信用代码查询宗教信息
export function getZongJiaoInfo(data){
  return http.postJson(url + `api/farmerHouse/bizShareMaker/getZongJiaoInfo`,data)
}


// 根据社会统一信用代码查询宗教信息
export function getuserRelManyBiz(data){
  return http.postJson(url + `/api/farmerHouse/zlbsso/userRelManyBiz?username=`+data)
}
